﻿using System;

namespace Zocono.WCS.Domain.PlcBytesObject
{
    public class PlanarInventoryWriteWcsAction : WriteByteObjectBase
    {

        public PlanarInventoryWriteWcsAction() { }
        public PlanarInventoryWriteWcsAction(long plcConnectionID
            , long plcWriteDbID
            , int dbCode
            , int dbStart
            , string objectType
            , short actionType)
        {
            PlcConnectionID = plcConnectionID;
            PlcWriteDbID = plcWriteDbID;
            DbCode = dbCode;
            DbStart = dbStart;
            ObjectType = objectType;
            ActionType = actionType;
        }

        /// <summary>
        /// 握手类型
        /// </summary>
        public short ActionType { get; set; }

        public override byte[] Deserialize()
        {
            byte[] bytes = new byte[2];

            HelperByte.SetIntAt(bytes, 0, ActionType);
            return bytes;
        }
    }
}
